window.onload=function(){
    //注册一级菜单的mouseover事件，当鼠标移动到一级菜单上之后，让他的子集菜单显示出来
    var menu = document.getElementById("menu");
    //遍历menu的子标签li
    for(var i = 0;i<menu.children.length;i++){
        var li = menu.children[i];
        li.addEventListener("mouseover",function(){
            var subul=this.children[0];
            subul.style.display = "block";
        },false);
        var li = menu.children[i];
        li.addEventListener("mouseout",function(){
            var subul=this.children[0];
            subul.style.display = "none";
        },false);
    }
};
